import axios from './AxiosHelper'
import {IProductInputDto, IProductPropInputDto, IShoppingCartInputDto} from '@/interfaces/ProductList'

export const getProduct = async (data: IProductInputDto) => {
  const res = await axios.get('product', {params: data})
  return res.data
}

export const getBelongType = async () => {
  const res = await axios.get('product/belongType')
  return res.data
}

export const getType = async (belongTypeName: string) => {
  const res = await axios.get('product/type?belongTypeName=' + belongTypeName)
  return res.data
}

export const getPror = async (data: IProductPropInputDto) => {
  const res = await axios.get('product/props', {params: data})
  return res.data
}

export const addCart = async (data: IShoppingCartInputDto) => {
  const res = await axios.post('ShoppingCart', data)
  return res.data
}


